package com.example.aerospacemanagementsystem.controller.personnel;

import com.example.aerospacemanagementsystem.entity.personnel.Manager;
import com.example.aerospacemanagementsystem.service.personnelService.ManagerService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 吴欣悦
 */

@Api(tags = "物业")
@RestController
@CrossOrigin
@RequestMapping("/manager")
public class ManagerController {
    @Autowired
    private ManagerService managerService;
    //添加物业
    @PostMapping
    public int add(@RequestBody Manager manager){
        return managerService.add(manager);
    }
    //删除物业
    @DeleteMapping
    public int delete(Manager manager){
        return managerService.delete(manager);
    }
    //修改物业
    @PutMapping
    public int update(@RequestBody Manager manager){
        return managerService.update(manager);}
    //获取物业
    @GetMapping("/getAll")
    public List<Manager> getAllCity(Manager manager) {
        List<Manager> list = managerService.getAllManager(manager);
        return list;
    }
}

